/*
 * @Description: 文章-点赞实体关系。记录用户对文章的点赞状态
 * @Author: liks
 * @Date: 2025-01-06 15:04:21
 * @LastEditors: liks
 * @LastEditTime: 2025-01-06 15:13:01
 */
import { Entity, PrimaryGeneratedColumn, ManyToOne, JoinColumn } from 'typeorm';
import { User } from '../../user/entities/user.entity';
import { Article } from './article.entity';

@Entity('article-like')
export class ArticleLike {
  @PrimaryGeneratedColumn('uuid')
  id: string;

  @ManyToOne(() => User, user => user.articleLikes)
  @JoinColumn()
  user: User;

  @ManyToOne(() => Article, article => article.likes)
  @JoinColumn()
  article: Article;
}